package com.liuzu.esys.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.liuzu.esys.bo.OrderManageBo;
import com.liuzu.esys.pojo.OrderManage;
import com.liuzu.esys.service.OrderManageService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

public class WebOrderManageListener extends AnalysisEventListener<OrderManageBo> {
    @Autowired
    OrderManageService orderManageService;


    @Override
    public void invoke(OrderManageBo data, AnalysisContext analysisContext) {
        System.out.println(data);
        OrderManage orderManage = new OrderManage();

        BeanUtils.copyProperties(data,orderManage);
        orderManageService.orderManageAdd(orderManage);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

}
